requireJS(['constant', 'site', 'handlebars'], function (Constant, site, Handlebars) {
    //日期控件初始化
    $(".datepicker").datepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        pickerPosition: 'bottom',
    })

    var init = function () {
        // site.send({
        //     url: '',//毁约款列表
        //     //async:false
        //     callback: function (data) {
        //         var list = JSON.parse(data);
        // var data = {"content":{"endRow":10,"firstPage":1,"hasNextPage":true,"hasPreviousPage":false,"isFirstPage":true,"isLastPage":false,"lastPage":4,"list":[{"d2_name":"长沙分公司","periods":"第1期","status":2,"admin_name":"鼎信D","iDate":0,"repayment_time":"2019-03-08","repayment_money":123791.92,"id":542,"apply_money":80000,"s_name":"等待还款","personal_name":"毛超","d1_name":"渠道部","sumP":1,"repayment_time_stmp":1551974400000,"p_id":212,"d3_name":"总经办","at_name":"24个月","sum_money":1904},{"d2_name":"业务部","periods":"第3期","status":2,"admin_name":"朱宝宝","iDate":40,"repayment_time":"2018-03-25","repayment_money":150000,"id":409,"apply_money":150000,"s_name":"等待还款","personal_name":"闫清爽","d1_name":"福田业务F1组","sumP":3,"repayment_time_stmp":1521907200000,"p_id":167,"d3_name":"深圳分公司","at_name":"3个月","sum_money":27000},{"d2_name":"业务部","periods":"第6期","status":2,"admin_name":"梁敏","iDate":48,"repayment_time":"2018-03-17","repayment_money":66666.67,"id":145,"apply_money":400000,"s_name":"等待还款","personal_name":"付愿","d1_name":"福田业务F3组","sumP":6,"repayment_time_stmp":1521216000000,"p_id":109,"d3_name":"深圳分公司","at_name":"6个月","sum_money":393789.35},{"d2_name":"业务部","periods":"第5期","status":2,"admin_name":"朱宝宝","iDate":67,"repayment_time":"2018-02-26","repayment_money":53750,"id":152,"apply_money":150000,"s_name":"等待还款","personal_name":"冉启斌","d1_name":"福田业务F1组","sumP":5,"repayment_time_stmp":1519574400000,"p_id":112,"d3_name":"深圳分公司","at_name":"6个月","sum_money":118750},{"d2_name":"业务部","periods":"第2期","status":2,"admin_name":"朱宝宝","iDate":73,"repayment_time":"2018-02-20","repayment_money":477000,"id":389,"apply_money":450000,"s_name":"等待还款","personal_name":"凌国程","d1_name":"福田业务F1组","sumP":2,"repayment_time_stmp":1519056000000,"p_id":163,"d3_name":"深圳分公司","at_name":"3个月","sum_money":54000},{"d2_name":"业务部","periods":"第2期","status":2,"admin_name":"杨根连","iDate":74,"repayment_time":"2018-02-19","repayment_money":159000,"id":386,"apply_money":150000,"s_name":"等待还款","personal_name":"张会芬","d1_name":"宝安业务A组","sumP":2,"repayment_time_stmp":1518969600000,"p_id":162,"d3_name":"深圳分公司","at_name":"3个月","sum_money":18000},{"d2_name":"业务部","periods":"第2期","status":2,"admin_name":"黄蓝","iDate":103,"repayment_time":"2018-01-21","repayment_money":400000,"id":297,"apply_money":400000,"s_name":"等待还款","personal_name":"易丽琴","d1_name":"宝安业务B组","sumP":2,"repayment_time_stmp":1516464000000,"p_id":156,"d3_name":"深圳分公司","at_name":"2个月","sum_money":56000},{"d2_name":"业务部","periods":"第13期(第2次续期)","status":2,"admin_name":"邓冬冬","iDate":110,"repayment_time":"2018-01-14","repayment_money":666250,"id":12,"apply_money":650000,"s_name":"等待还款","personal_name":"吴志坚","d1_name":"宝安业务A组","sumP":13,"repayment_time_stmp":1515859200000,"p_id":13,"d3_name":"深圳分公司","at_name":"14个月","sum_money":212050},{"d2_name":"业务部","periods":"第10期","status":2,"admin_name":"张慧","iDate":119,"repayment_time":"2018-01-05","repayment_money":93000,"id":3,"apply_money":300000,"s_name":"等待还款","personal_name":"陈槟城,张少虹","d1_name":"宝安业务C组","sumP":10,"repayment_time_stmp":1515081600000,"p_id":4,"d3_name":"深圳分公司","at_name":"12个月","sum_money":323800},{"d2_name":"业务部","periods":"第4期","status":2,"admin_name":"杨根连","iDate":126,"repayment_time":"2017-12-29","repayment_money":150000,"id":230,"apply_money":150000,"s_name":"等待还款","personal_name":"张会芬","d1_name":"宝安业务A组","sumP":4,"repayment_time_stmp":1514476800000,"p_id":150,"d3_name":"深圳分公司","at_name":"4个月","sum_money":65000}],"navigatePages":5,"navigatepageNums":[1,2,3,4],"nextPage":2,"orderBy":"","pageNum":1,"pageSize":10,"pages":4,"prePage":0,"size":10,"startRow":1,"total":33},"type":1,"msg":"成功"}
        var data = {
            "content": {
                "endRow": 10,
                "firstPage": 1,
                "hasNextPage": true,
                "hasPreviousPage": false,
                "isFirstPage": true,
                "isLastPage": false,
                "lastPage": 5,
                "list": [{
                    "add_time_stmp": 1522295289439,
                    "id": 249,
                    "status": 1,
                    "deposit": 2700,
                    "oid": 587,
                    "union_name": "陶秋良",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 245,
                    "frequency": 0,
                    "add_time": "2018-03-29 11:48:09",
                    "type": 1,
                    "residual_amount": 2700,
                    "loan_number": "FD20180314175200958"
                }, {
                    "add_time_stmp": 1522295266123,
                    "id": 248,
                    "status": 1,
                    "deposit": 3000,
                    "oid": 603,
                    "union_name": "黄继",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 244,
                    "frequency": 0,
                    "add_time": "2018-03-29 11:47:46",
                    "type": 1,
                    "residual_amount": 3000,
                    "loan_number": "FD20180319143347277"
                }, {
                    "add_time_stmp": 1522295244424,
                    "id": 247,
                    "status": 1,
                    "deposit": 1800,
                    "oid": 589,
                    "union_name": "戴红兵",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 243,
                    "frequency": 0,
                    "add_time": "2018-03-29 11:47:24",
                    "type": 1,
                    "residual_amount": 1800,
                    "loan_number": "FD20180315110749974"
                }, {
                    "add_time_stmp": 1522295222563,
                    "id": 246,
                    "status": 1,
                    "deposit": 2400,
                    "oid": 619,
                    "union_name": "熊珊",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 242,
                    "frequency": 0,
                    "add_time": "2018-03-29 11:47:02",
                    "type": 1,
                    "residual_amount": 2400,
                    "loan_number": "FD20180322115727605"
                }, {
                    "add_time_stmp": 1522295181753,
                    "id": 245,
                    "status": 1,
                    "deposit": 1500,
                    "oid": 610,
                    "union_name": "杨涵",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 241,
                    "frequency": 0,
                    "add_time": "2018-03-29 11:46:21",
                    "type": 1,
                    "residual_amount": 1500,
                    "loan_number": "FD20180320143012104"
                }, {
                    "add_time_stmp": 1521797031455,
                    "id": 244,
                    "status": 1,
                    "deposit": 1500,
                    "oid": 555,
                    "union_name": "陈珂",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 240,
                    "frequency": 0,
                    "add_time": "2018-03-23 17:23:51",
                    "type": 1,
                    "residual_amount": 1500,
                    "loan_number": "FD20180305153747632"
                }, {
                    "add_time_stmp": 1521706072646,
                    "id": 243,
                    "status": 1,
                    "deposit": 2400,
                    "oid": 529,
                    "union_name": "张文开",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 239,
                    "frequency": 0,
                    "add_time": "2018-03-22 16:07:52",
                    "type": 1,
                    "residual_amount": 2400,
                    "loan_number": "FD20180301105806822"
                }, {
                    "add_time_stmp": 1521706043635,
                    "id": 242,
                    "status": 1,
                    "deposit": 2700,
                    "oid": 579,
                    "union_name": "尹赞新",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 238,
                    "frequency": 0,
                    "add_time": "2018-03-22 16:07:23",
                    "type": 1,
                    "residual_amount": 2700,
                    "loan_number": "FD20180313114509798"
                }, {
                    "add_time_stmp": 1521706006006,
                    "id": 241,
                    "status": 1,
                    "deposit": 2400,
                    "oid": 575,
                    "union_name": "刘利米",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 237,
                    "frequency": 0,
                    "add_time": "2018-03-22 16:06:46",
                    "type": 1,
                    "residual_amount": 2400,
                    "loan_number": "FD20180312092301071"
                }, {
                    "add_time_stmp": 1521705984171,
                    "id": 240,
                    "status": 1,
                    "deposit": 3600,
                    "oid": 576,
                    "union_name": "廖文",
                    "deduction": 1,
                    "handle_money": 0,
                    "pid": 236,
                    "frequency": 0,
                    "add_time": "2018-03-22 16:06:24",
                    "type": 1,
                    "residual_amount": 3600,
                    "loan_number": "FD20180312145316170"
                }],
                "navigatePages": 5,
                "navigatepageNums": [1, 2, 3, 4, 5],
                "nextPage": 2,
                "orderBy": "",
                "pageNum": 1,
                "pageSize": 10,
                "pages": 20,
                "prePage": 0,
                "size": 10,
                "startRow": 1,
                "total": 200
            }, "type": 1, "msg": "成功"
        }
        var source = $("#refund_content_tpl").html();
        var template = Handlebars.compile(source);
        var html = template(data);
        $("#refund_content").html(html);

        //     }
        // })


    }
    init();
})